#ifndef SPI_H_
#define SPI_H_

// SPI Control Macros
#define MOSI_HIGH()     P3OUT |= SPIMoSi
#define MOSI_LOW()		P3OUT &= ~SPIMoSi
#define SCLK_HIGH()		P3OUT |= SPIClk
#define SCLK_LOW()		P3OUT &= ~SPIClk

// SPI MISO bit
#define MISO_BIT_NUM    (2)
#define MISO            ((P3IN & SPIMiSo) >> MISO_BIT_NUM)

// Magnetometer SPI Enable
#define ENABLE_MAG()  	P3OUT &= ~SPIEnblMag
#define DISABLE_MAG() 	P3OUT |= SPIEnblMag

// Z Gyro SPI Enable
#define ENABLE_GYRO()  	P2OUT &= ~SPIEnblGyroZ
#define DISABLE_GYRO() 	P2OUT |= SPIEnblGyroZ

// Accelerometer SPI Enable
#define ENABLE_ACCEL()  P2OUT &= ~SPIEnblAccel
#define DISABLE_ACCEL() P2OUT |= SPIEnblAccel

#endif /*SPI_H_*/
